package com.ly.mp.dal.comm.config;

import java.util.Collection;
import java.util.Iterator;

import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;

public final class PreciseModuloShardingTableAlgorithm implements PreciseShardingAlgorithm<Integer> {
    public String doSharding(Collection<String> tableNames, PreciseShardingValue<Integer> shardingValue) {
        Iterator var3 = tableNames.iterator();

        String each;
        do {
            if (!var3.hasNext()) {
                throw new UnsupportedOperationException();
            }

            each = (String) var3.next();
        } while (!each.endsWith((Integer) shardingValue.getValue() % 2 + ""));

        return each;
    }
}